#ifndef REPLICATION_IGNORE_H_
#define REPLICATION_IGNORE_H_
/**
 * Since we apply the local changes directly, we have to ignore
 * them when they come back from the master server.
 * They boil down to three cases:
 * 1- whole table truncated. Some apps truncate the entire file before
 * rewriting it. we should not re-truncate.
 * 2- partially truncated file causes deletes on server,
 * these deletes must be ignored when they come back from the server.
 * 3- when the file is appended, inserts are issued to server. These inserts
 * must be ignored when they come back from the server.
 */
#include <stddef.h>
#include <string>
using namespace std;
namespace repl_ignore {
	void inc_truncate(const string& table);
	bool shall_skip_truncate(const string& table);
	void add_insert(const string& table, size_t rowSize);
	bool shall_skip_insert(const string& table, size_t rowSize);
	void add_delete(const string& table, size_t rowSize);
	bool shall_skip_delete(const string& table, size_t rowSize);
	void init();
};
#endif
